<!DOCTYPE html>
<html>
<head>
<title>login</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<style>
    
</style>
    <script src="static/js/jquery.js" type="text/javascript"></script>

</head>
<body>
<h1>Please login</h1>


<form id="loginForm" method="post" >

username:<input type="text" id="username" name="username"/><br/>
passowrd:<input type="password" id="password" name="password"/><br/>
<input id="loginBtn" type="button" value="login"/>

</form>

</body>

	<script type="text/javascript">
		$(function () {
			
			$('#loginBtn').click(function(){
				var username = $('#username').val();
				var password = $('#password').val();
				var info = {};
				/**
				info.userId = 123;
				info.actTime = new Date();
				info.action = _action;
				info.jobCode = "lagou";
				*/
				info.username = username;
				info.password = password;
				$.ajax({
					url: 'http://154.8.202.121:8081/lagou/login',//?username='+username+'&password='+password,
					type:"post",
					data: JSON.stringify(info),
					async:false,
					cache:false,
					dataType:"text",
					success:function(r){
						console.info('success...........');
						if(r=='success'){
							location.href = "lagou.html";
						}
					},error:function(r){
						alert('error');
						console.info(r);
					}
				}).done(function(r) { 
					if(r=='success'){
						location.href = "lagou.html";
					}
				});
			
			});	

	    });
	</script>
</html>
